#!/usr/bin/env node

const fs=require('fs'),
      fileName=process.argv[2],
      log=console.log;

//同步方式打印文件内容
let num=1;
try{
  
  //log(fs.readFileSync(fileName).toString('utf8'));
  fs.readFileSync(fileName)
    .toString('utf8')
    .split('\n')
    .forEach((line)=>
      log(`${num++}\t${line}`)
    );


}catch(e){
  log(e.message);
}
